package com.roger.springcloudGreenwich.receiver;


import com.roger.message.domain.OrderMsg;
import com.roger.message.domain.Topics;
import lombok.extern.slf4j.Slf4j;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

/**
 * Created by yulei on 2019/6/16.
 */
@Component
@Slf4j
public class KafkaReceiver {

    private static final String COMMENT_GROUP = "comment-group";

    @KafkaListener(topics = Topics.ORDER_TOPIC, groupId = COMMENT_GROUP)
    public void onMessage(OrderMsg orderMsg){
        System.out.println("接收的消息:" + orderMsg);
    }
}
